package net.siufung.market.base.permit.provider;

import lombok.AllArgsConstructor;
import net.siufung.core.model.enums.DeletedEnum;
import net.siufung.market.base.app.spi.IUpdateMenuSpi;
import net.siufung.market.base.permit.service.IMenuService;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * @author 陈建峰
 * @date 2023/1/13 6:00 PM
 * @since V1.0.0
 */
@AllArgsConstructor
public class UpdateMenuProvider implements IUpdateMenuSpi {

    private final IMenuService menuService;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updateRelatedMenuStatus(Serializable appId, DeletedEnum deletedEnum) {
        menuService.updateStatusById(appId, deletedEnum);
    }
}
